<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script>
        $(function(){
            $('#bt1').click(function (){
                $.ajax({
                    url:'../login',
                    type:'POST',
                    data:{username:'admin',password:'123456'},
                    success:function (data){
                        var test=JSON.stringify(data);
                        alert(test);
                        $('#text1').val("hjjjj");
                    },
                    dataType:"json"
                })
            });
        });

    </script>
</head>
<body>
    <h1>你好！</h1>
    <form>
        <input id="bt1" type="button" value="asdad">
        <input id="text1" type="text">
    </form>
</body>
</html>